<template>
  <div>
    {{ $route.query.test1 }}
    <hr />

    <router-view></router-view>

    <hr />
    <!-- <button @click="btnClk3">点击</button> -->
  </div>
</template>

<script>
export default {
  props: ["test1", "test5", "abc"],
  data() {
    return {
      num: 74,
    };
  },
  mounted() {
    // console.log(this.$route.params.test1);
    // console.log(this.test1);
    // console.log(this.$route.meta.requiresAuth);
  },
  methods: {
    btnClk3() {
      this.$router.push("/about");
    },
  },
  beforeRouteEnter(to, from, next) {
    console.log(to);
    console.log(from);
    next((vm) => {
      // 通过 `vm` 访问组件实例
      console.log(vm);
    });
  },
  // beforeRouteUpdate(to, from, next) {
  //   console.log(to);
  //   console.log(from);
  //   next();
  // },
  // beforeRouteLeave(to, from, next) {
  //   console.log(to);
  //   console.log(from);
  //   next();
  // },
};
</script>

<style scoped></style>
